<template>
  <div class></div>
</template>
<script>
import axios from "@/utils/requestzz";

export default {
  name: "APIconnectorList",
  components: {},
  data() {
    return {};
  },
  computed: {
    ishistory: function() {
      return this.$store.state.daping.ishistorytime;
    },
    timerangarr: function() {
      return this.$store.state.daping.timepick;
    }
  },
  watch: {},
  mounted() {
    this.watchEvent();
  },
  methods: {
    watchEvent() {
      //先清除定时任务
      if (
        this.$store.state.daping.intervalArr["APIconnectorList"] != undefined
      ) {
        clearInterval(
          this.$store.state.daping.intervalArr["APIconnectorList"][0].interval
        );
      }
      this.loadData();
      let interval = setInterval(() => {
        this.loadData();
      }, this.$root.setting.data.interval);
      this.$store.state.daping.intervalArr["APIconnectorList"] = [
        { interval: interval }
      ];
    },
    loadData() {

      axios.get("model/connectorlist?ctype=1").then(res => {
        let addWaterName = res.data;
        this.$store.state.daping.connectorList = addWaterName;
      })
    }
  }
};
</script>
<style lang='scss' scoped>
</style>